<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="th/include/common_head :: head(~{::title}, ~{::link}, ~{::style})">
    <title>系统变量</title>
    <link type="text/css" rel="stylesheet" th:href="@{${skinPath} + '/css.css'}"/>
    <style>
        .table th, .table td {
            vertical-align: middle !important;
        }
    </style>
</head>
<body>
<div th:replace="th/include/tab_config_sys :: navConfigSys(2)"></div>
<div class="spacerH"></div>
<div class="container" style="margin-top: 10px">
    <div class="row">
        <div class="col-lg-10 col-lg-offset-1">
            <div class="table-responsive">
                <form method="post" id="form1">
                    <table class="table table-bordered table-hover">
                        <tr>
                            <td class="tabStyle_1_title" height="24" colspan="2" align="center">系统变量</td>
                        </tr>
                        <tr>
                            <td width="36%" height="24" align="right">服&nbsp;务&nbsp;器：</td>
                            <td width="64%" align="left" class="form-inline form-group"><input name="Application.server" class="form-control" th:value="${global.server}"/></td>
                        </tr>
                        <tr>
                            <td height="24" align="right">端口：</td>
                            <td align="left" class="form-inline form-group"><input name="Application.port" class="form-control" th:value="${global.port}"/></td>
                        </tr>
                        <tr style="display: none;">
                            <td height="24" align="right">描述：</td>
                            <td align="left" class="form-inline form-group"><input type="text" name="Application.desc" class="form-control" th:value="${global.desc}"/>
                                ( 描述：用在RSS中 )
                            </td>
                        </tr>
                        <tr>
                            <td height="24" align="right">调试状态：</td>
                            <td align="left" class="form-inline form-group">
                                <select id="isDebug" name="Application.isDebug" class="form-control">
                                    <option value="true">是</option>
                                    <option value="false">否</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td height="24" align="right">虚拟路径：</td>
                            <td align="left" class="form-inline form-group"><input type="text" name="Application.virtualPath" class="form-control" th:value="${global.virtualPath}"/></td>
                        </tr>
                        <tr>
                            <td height="24" align="right">真实路径：</td>
                            <td align="left" class="form-inline form-group"><input type="text" name="Application.realPath" class="form-control" th:value="${global.realPath}"/>
                                ( 请使用 / 符号 )
                            </td>
                        </tr>
                        <tr>
                            <td height="24" align="right">浏览器上传时单个文件的最大尺寸：</td>
                            <td align="left" class="form-inline form-group"><input type="text" name="Application.FileSize" class="form-control" th:value="${global.fileSize}"/>
                                ( 单位：K )
                            </td>
                        </tr>
                        <tr style="display: none">
                            <td height="24" align="right">WebEdit控件上传时的最大尺寸：</td>
                            <td align="left" class="form-inline form-group"><input type="text" name="Application.WebEdit.MaxSize" class="form-control" th:value="${global.maxSize}"/>
                                ( 单位：字节，含HTML代码和附件总的大小 )
                            </td>
                        </tr>
                        <tr>
                            <td height="24" align="right">服务器是否直接支持中文：</td>
                            <td align="left" class="form-inline form-group">
                                <select name="Application.isRequestSupportCN" class="form-control">
                                    <option value="true">是</option>
                                    <option value="false" selected="selected">否</option>
                                </select>
                                <div>( Tomcat 默认选是，如果使用了防乱码过滤器选是，注意慎重选用，否则在提交后可能会出现乱码 )</div>
                            </td>
                        </tr>
                        <tr>
                            <td height="24" align="right">是否启用调度：</td>
                            <td align="left" class="form-inline form-group">
                                <select name="Application.isSchedule" class="form-control">
                                    <option value="true">是</option>
                                    <option value="false">否</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td height="24" align="right">系统是否正式启用：</td>
                            <td align="left" class="form-inline form-group">
                                <select name="Application.isFormalOpen" class="form-control">
                                    <option value="true">是</option>
                                    <option value="false">否</option>
                                </select>
                                ( 如正式启用，则需以管理员身份登录后才能进行setup操作 )
                            </td>
                        </tr>
                        <tr>
                            <td height="24" align="right">是否启用缓存：</td>
                            <td align="left" class="form-inline form-group">
                                <select name="Application.useCache" class="form-control">
                                    <option value="true">是</option>
                                    <option value="false" selected="selected">否</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td height="24" align="right">是否使用Redis：</td>
                            <td align="left" class="form-inline form-group">
                                <select name="Application.isUseRedis" class="form-control">
                                    <option value="true">是</option>
                                    <option value="false" selected="selected">否</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td height="24" align="right">Redis服务器：</td>
                            <td align="left" class="form-inline form-group"><input name="Application.redisHost" class="form-control" th:value="${global.redisHost}"/></td>
                        </tr>
                        <tr>
                            <td height="24" align="right">Redis端口：</td>
                            <td align="left" class="form-inline form-group"><input name="Application.redisPort" class="form-control" th:value="${global.redisPort}"/></td>
                        </tr>
                        <tr>
                            <td height="24" align="right">Redis密码：</td>
                            <td align="left" class="form-inline form-group"><input name="Application.redisPassword" class="form-control" th:value="${global.redisPassword}"/></td>
                        </tr>
                        <tr>
                            <td height="24" align="right">Redis资源池中最大连接数：</td>
                            <td align="left" class="form-inline form-group"><input name="Application.redisMaxTotal" class="form-control" th:value="${global.redisMaxTotal}"/></td>
                        </tr>
                        <tr>
                            <td height="24" align="right">Redis资源池允许最大空闲的连接数：</td>
                            <td align="left" class="form-inline form-group"><input name="Application.redisMaxIdle" class="form-control" th:value="${global.redisMaxIdle}"/></td>
                        </tr>
                        <tr>
                            <td height="24" align="right">Redis资源池初始化连接数：</td>
                            <td align="left" class="form-inline form-group"><input name="Application.redisMinIdle" class="form-control" th:value="${global.redisMinIdle}"/></td>
                        </tr>
                        <tr>
                            <td height="24" align="right">Redis当资源池连接用尽后，调用者的最大等待时间，单位为毫秒：</td>
                            <td align="left" class="form-inline form-group"><input name="Application.redisMaxWaitMillis" class="form-control" th:value="${global.redisMaxWaitMillis}"/></td>
                        </tr>
                        <tr>
                            <td height="24" align="right">Redis db序号（0-15）：</td>
                            <td align="left" class="form-inline form-group"><input name="Application.redisDb" class="form-control" th:value="${global.redisDb}"/></td>
                        </tr>
                        <tr>
                            <td height="24" colspan="2" align="center">
                                <button id="btnOk" class="btn btn-default">确定</button>
                            </td>
                        </tr>
                    </table>
                </form>
                <b>注：点击“确定”，可以重新生成登录界面的二维码（可下载APP或配置APP登录地址）</b>
                <br/>
                <br/>
            </div>
        </div>
    </div>
</div>
</body>
<script th:inline="javascript">
    $(function () {
        o("Application.isRequestSupportCN").value = [[${global.requestSupportCN}]];
        $('#isDebug').val("[[${global.debug}]]");
        o("Application.isFormalOpen").value = [[${global.formalOpen}]];
        o("Application.useCache").value = [[${global.useCache}]];
        o("Application.isUseRedis").value = [[${global.useRedis}]];
        o("Application.isSchedule").value = [[${global.schedule}]]

        $('#btnOk').click(function(e) {
            e.preventDefault();
            $.ajax({
                type: "post",
                url: "editConfigSys.do",
                data: $('#form1').serialize(),
                dataType: "json",
                beforeSend: function(XMLHttpRequest) {
                    $('body').showLoading();
                },
                success: function (data, status) {
                    jAlert(data.msg, "提示");
                },
                complete: function (XMLHttpRequest, status) {
                    $('body').hideLoading();
                },
                error: function() {
                    alert(XMLHttpRequest.responseText);
                }
            });
        });
    });
</script>
</html>                            
  